package com.hdyg.sixg.mvp.presenter;

import com.hdyg.sixg.entry.CountryBean;
import com.hdyg.sixg.httpUtil.HttpCallback;
import com.hdyg.sixg.mvp.Contrant.CWelcome;
import com.hdyg.sixg.mvp.base.BasePresenter;
import com.hdyg.sixg.util.ToastUtil;
import java.util.List;
import java.util.Map;

/**
 * @author CZB
 * @describe    启动页
 * @time 2019/4/10 11:51
 */

public class PWelcome extends BasePresenter implements CWelcome.IPWelcome {

    private CWelcome.IVWelcome mView;

    public PWelcome(CWelcome.IVWelcome mView) {
        this.mView = mView;
    }

    @Override
    public void pGetAreaCode(String path, Map<String, String> params) {
        mModel.post(path, params, new HttpCallback<List<CountryBean>>(false) {
            @Override
            public void onSuccess(List<CountryBean> countryBeanList) {
                mView.vGetAreaCodeSuccess(countryBeanList);
            }

            @Override
            public void onFail(String code, String error) {
                ToastUtil.show(error);
            }
        });
    }
}
